package cn.dengyongsheng

import sttp.client3._

//val sort: Option[String] = None
//val query = "http language:scala"

// the `query` parameter is automatically url-encoded

object Hello {
  def main(args: Array[String]): Unit = {
    val request = basicRequest.get(uri"https://dengyongsheng.cn")

    val backend = HttpClientSyncBackend()
    val response = request.send(backend)

    // response.header(...): Option[String]
    println(response.header("Content-Length"))

    // response.body: by default read into an Either[String, String] to indicate failure or success
    println(response.body)
  }
}